package se.webbzon.boltzmann.battle.strategy.playerstrategy;

import se.webbzon.boltzmann.input.Button;
import se.webbzon.oschi01.worldcamera.WorldCameraPane;

public abstract class AbstractPSPage {
	
	// The parent page to this abstract player strategy page
	private final AbstractPSPage parent;
	
	/*============================================================
	Constructors
	============================================================*/
	
	/** Creates a new abstract player strategy page with no parent. **/
	public AbstractPSPage() {
		this(null);
	}
	
	/** Creates a new abstract player strategy page with a parent. **/
	public AbstractPSPage(AbstractPSPage parent) {
		this.parent = parent;
	}
	
	/*============================================================
	Public Methods
	============================================================*/
	
	/** This method is invoked when the player presses the select button
	 * in the strategy page. **/
	public abstract void onSelect(PlayerStrategyHud psh);
	
	/** This method is invoked when the player presses the return button
	 * in the strategy page. **/
	public abstract void onReturn(PlayerStrategyHud psh);
	
	/** This method is invoked when the player presses any button
	 * (except the select and return button) in the strategy page. **/
	public abstract void onPress(PlayerStrategyHud psh, Button button);
	
	/** This method is invoked during each step of the player strategy
	 * heads-up display. **/
	public abstract void onStep(PlayerStrategyHud psh);
	
	/** This method is invoked when the player strategy page is rendered. **/
	public abstract void onDraw(PlayerStrategyHud psh, WorldCameraPane hud);
	
	/** Returns true if this player strategy page has a parent. **/
	public boolean hasParent() {
		return (parent != null);
	}
	
	/** Returns the parent of this player strategy page. If the page has
	 * no parent then null is returned. **/
	public AbstractPSPage getParent() {
		return parent;
	}

}
